package br.sales.entity;

import java.io.Serializable;

public class MediaSocialEntity implements Serializable{

	
	public static final String FACEBOOK  = "facebook";
	public static final String TWITTER   = "twitter";
	public static final String LINKEDIN  = "linkedin";
	public static final String ABOUTME   = "aboutme";
	public static final String EMAIL     = "email";
	public static final String GOOGLE    = "google";
	
	private long id;
	private String profile;
	private String type;

	private UserEntity owner;
	
	public MediaSocialEntity() {
	}

	public UserEntity getOwner() {
		return owner;
	}

	public void setOwner(UserEntity owner) {
		this.owner = owner;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public MediaSocialEntity(String type, UserEntity owner) {
		this.type = type;
		this.owner = owner;
	}

	public String getProfile() {
		return profile;
	}
	
	public void setProfile(String profile) {
		this.profile = profile;
	}

	public MediaSocialEntity(long id, String profile, String type,
			UserEntity owner) {
		super();
		this.id = id;
		this.profile = profile;
		this.type = type;
		this.owner = owner;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (id ^ (id >>> 32));
		result = prime * result + ((owner == null) ? 0 : owner.hashCode());
		result = prime * result + ((profile == null) ? 0 : profile.hashCode());
		result = prime * result + ((type == null) ? 0 : type.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MediaSocialEntity other = (MediaSocialEntity) obj;
		if (id != other.id)
			return false;
		if (owner == null) {
			if (other.owner != null)
				return false;
		} else if (!owner.equals(other.owner))
			return false;
		if (profile == null) {
			if (other.profile != null)
				return false;
		} else if (!profile.equals(other.profile))
			return false;
		if (type == null) {
			if (other.type != null)
				return false;
		} else if (!type.equals(other.type))
			return false;
		return true;
	}
	

	
}
